﻿using WenAntdUI.Helps;
using WenAntdUI.Services;

namespace WenAntdUI.Forms;

public partial class SysMainForm : MenuForm
{
    public SysMainForm(IdentityService identity, MenuService menu)
    {
        InitializeComponent();

        if (identity.SysUser != null)
        {
            if (identity.SysUser.Icon != null)
            {
                this.UserInfoImage = ImageHelp.GetImage(identity.SysUser.Icon);
            }
            this.UserInfoDisplayName = identity.DisplayName;
            this.UserInfoIconSize = new Size(26, 26);
        }

        var steebutton = new AntdUI.Button()
        {
            IconSvg = "SettingOutlined",
            Dock = DockStyle.Right,
            Width = 40,
        };
        steebutton.Click += (s, e) => new Settings.SettingsForm().ShowDialog();
        this.TopControls.Add(steebutton);

        this.StartPosition = FormStartPosition.CenterScreen;
        this.Size = new Size(1280, 790);

        this.SetMenuTabs(menu.GetUserMenuTagItems());
    }

    private void SelectMenuDefault()
    {

    }
}
